package com.lff.service.impl;

import com.lff.domain.Provider;
import com.lff.mapper.ProviderMapper;
import com.lff.service.ProviderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ProviderServiceImpl implements ProviderService {
    @Autowired
    private ProviderMapper providerMapper;
    @Override
    public List<Provider> findAll(String queryProCode, String queryProName) {
        return providerMapper.findAll(queryProCode,queryProName);
    }

    @Override
    public Provider getProvider(Long id) {
        return providerMapper.findById(id);
    }

    @Override
    public void updateProv(Provider provider) {
        providerMapper.updateProvider(provider);
    }

    @Override
    public void save(Provider provider) {
        providerMapper.addProv(provider);
    }

    @Override
    public Integer delProv(Long id) {
        return providerMapper.deleteById(id);
    }
}
